/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.ProjetoFinal.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author DCBorges
 */
@Entity
@Table(name = "sdctb005_ppl_prtce")
public class PapelParticipante implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "CO_PAPEL_PRTCPE")
    private Short coPapelPrtcpe;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 60)
    @Column(name = "NO_PAPEL_PRTCPE")
    private String noPapelPrtcpe;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "coPapelPrtce")
    private List<ParticipanteGrupo> participanteGrupoList;

    public PapelParticipante() {
    }

    public PapelParticipante(Short coPapelPrtcpe) {
        this.coPapelPrtcpe = coPapelPrtcpe;
    }

    public PapelParticipante(Short coPapelPrtcpe, String noPapelPrtcpe) {
        this.coPapelPrtcpe = coPapelPrtcpe;
        this.noPapelPrtcpe = noPapelPrtcpe;
    }

    public Short getCoPapelPrtcpe() {
        return coPapelPrtcpe;
    }

    public void setCoPapelPrtcpe(Short coPapelPrtcpe) {
        this.coPapelPrtcpe = coPapelPrtcpe;
    }

    public String getNoPapelPrtcpe() {
        return noPapelPrtcpe;
    }

    public void setNoPapelPrtcpe(String noPapelPrtcpe) {
        this.noPapelPrtcpe = noPapelPrtcpe;
    }

    public List<ParticipanteGrupo> getParticipanteGrupoList() {
        return participanteGrupoList;
    }

    public void setParticipanteGrupoList(List<ParticipanteGrupo> participanteGrupoList) {
        this.participanteGrupoList = participanteGrupoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (coPapelPrtcpe != null ? coPapelPrtcpe.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PapelParticipante)) {
            return false;
        }
        PapelParticipante other = (PapelParticipante) object;
        if ((this.coPapelPrtcpe == null && other.coPapelPrtcpe != null) || (this.coPapelPrtcpe != null && !this.coPapelPrtcpe.equals(other.coPapelPrtcpe))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ucb.ProjetoFinal.domain.PapelParticipante[ coPapelPrtcpe=" + coPapelPrtcpe + " ]";
    }
    
}
